﻿@model Transport.Areas.Administrator.Models.RegionModel
@{
    ViewBag.Title = "Đợt đóng gói - chuyển tiếp";
    Layout = "~/Areas/Administrator/Views/Shared/_Layout.cshtml";
}
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Areas/Administrator/Content/images/ico-catalog.png")" alt="" />
        @Model.RegionName - Danh Sách Các Đợt 
    </div>
    <div class="options">
        <a href="@Url.Action("CreatePackaging", "Parcel", new { id = Model.RegionId})" class="t-button">Tạo mới</a>
        <a href="@Url.Action("Packaging","Parcel")" tabindex="8" class="t-button">Quay về</a>
    </div>
</div>

@(Html.Telerik().Grid<Transport.Areas.Administrator.Models.ParcelPackagingGroupModel>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(x => x.ParcelPackagingGroupId).Title("MS")
            .Width(70)
            .Filterable(false);
        columns.Bound(x => x.CreateUser).Title("Người Tạo")
            .Filterable(false);
        columns.Bound(x => x.CreateDate).Title("Ngày Tạo").Format("{0:dd/MM/yyyy HH:mm:ss}")
            .Width(200)
            .Filterable(false);
        columns.Bound(p => p.ParcelPackagingGroupId)
            .ClientTemplate("<a href=" + Url.Action("EditPackaging", "Parcel", new { }) + "/<#= ParcelPackagingGroupId #>><img title=\"Sửa\" src=\"" + Url.Content("~/Content/Images/edit_16_16.png") + "\" /></a>")
            .HtmlAttributes(new { style = "text-align:center" })
            .Title(string.Empty)
            .Width(60).Sortable(false)
            .Filterable(false);
    }).Sortable(p => p.OrderBy(o => o.Add(b => b.ParcelPackagingGroupId).Descending()))
        .DataBinding(dataBinding => dataBinding.Ajax().Select("GridPackagingByRegionModel", "Parcel", new { id = Model.RegionId }))
    .Pageable()
    .Scrollable(scrolling => scrolling.Height(300))
    .Groupable(grouping => grouping.Enabled(false))
      .Filterable())

<br/>
<br/>
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Areas/Administrator/Content/Images/ico-catalog.png")" alt="" />
        @Model.RegionName - Bưu phẩm chưa đóng gói
    </div>
</div>

@(Html.Telerik().Grid<Transport.Areas.Administrator.Models.ParcelModel>()
        .Name("Parcel")
    .Columns(columns =>
    {
        columns.Bound(x => x.TrackingNumbers).Title("Số Vận Đơn")
                .Width(100)
                .Filterable(false);
        columns.Bound(x => x.DateOfSending).Title("Ngày Gửi").Format("{0:dd/MM/yyyy}")
            .Width(100)
            .Filterable(true);
        columns.Bound(x => x.CustomerName).Title("Khách hàng")
            .Width(250)
            .Filterable(true);
        columns.Bound(x => x.ToAddress).Title("Địa chỉ")
            .Filterable(false);
        columns.Bound(x => x.DeliverToName).Title("Nơi Đến")
            .Width(150)
            .Filterable(true);
        columns.Bound(x => x.RegionName).Title("Thùng")
            .Width(200)
            .Filterable(true).Hidden();
    })
    .DataBinding(dataBinding => dataBinding.Ajax().Select("ParcelNotPackagingGridModel", "Parcel", new { id = Model.RegionId }))
    .Pageable(pager => pager.PageSize(10000))
    .Scrollable()
    .Sortable(p => p.OrderBy(o => o.Add(b => b.ParcelId).Descending()))
    .Groupable(grouping => grouping.Enabled(false))
      .Filterable())